<template>
<div id="info">
  <NavBar>
  <div slot="left" class="left" @click="return_before"><van-icon name="arrow-left" /></div>
  <div slot="center">个人资料</div>
    <div slot="right" @click="send_info">保存</div>
</NavBar>
<div class="cell_1">
  <van-field
    v-model="email"
    name="邮箱"
    label="邮箱"
    :placeholder="beforeemail"
  />
</div>
</div>
</template>

<script>
import NavBar from "@/components/common/NavBar/NavBar";
import {formInfo} from "@/network/Users/put_info";
import {Infomessage} from "@/network/Users/get_info";

export default {
name: "Info",
  data(){
  return{
    email:'',
    beforeemail:''
  }
  },
  components:{
  NavBar
  },
    methods:{
  return_before(){
    history.go(-1)
  },
    send_info(){
    formInfo(this.email).then(
        res=>{
          console.log(res);
        }
    )
    }
},
  created() {
  Infomessage().then(
      res=>{
        this.email=res.info_data.email
      }
  )
  }
}
</script>

<style scoped>
.left .van-icon {
    font-size: 20px;
    position: relative;
    top: 3px;
    left: -8px;
}
#info{
  background-color: rgb(247,248,250);
  height: 1000px;
}
.cell_1{
  padding: 15px 0px;
}
</style>